<template>
  <!-- 收款明细 -->
  <el-dialog
    title="收款明细"
    v-model="visible"
    width="60%"
    destroy-on-close
    @closed="$emit('closed')"
  >
    <div class="top">
      <!-- <h4>客户：{{ title }}</h4> -->
      <!-- <el-button type="primary" @click="handleExport">导出</el-button> -->
    </div>
    <scTable ref="table" :apiObj="apiObj" :params="params" row-key="id" stripe>
      <el-table-column label="日期" prop="createTime"></el-table-column>
      <el-table-column label="收款金额" prop="money">
        <template #default="scope">
          <p>{{ scope.row.money }}元</p>
        </template>
      </el-table-column>
      <el-table-column label="备注" prop="remark"></el-table-column>
      <el-table-column label="状态">
        <template #default="scope">
          <p v-if="scope.row.paymentStatus === 0" style="color: #ad1025">
            未完成
          </p>
          <p v-if="scope.row.paymentStatus === 1" style="color: #398ee5">
            已完成
          </p>
        </template>
      </el-table-column>
    </scTable>
  </el-dialog>
</template>
  
<script>
export default {
  emits: ['closed'],
  data () {
    return {
      visible: false,
      apiObj: '',
      params: {

      },
      title: '',
    }
  },

  methods: {
    //显示
    open (data, api, type) {
      this.visible = true
      this.apiObj = api
      this.title = data.customerName
      // type 1 应收账款  2对账单
      type == 1 ? this.params.planId = data.id : this.params.billId = data.id
    },


  }
}
</script>  
<style lang="scss" scoped>
.top {
  display: flex;
  justify-content: space-between;
}
</style>